<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
</head>

<body>
  <button id="btn" type="button">点我</button>

  <script type="module">
    import EVM from "./evm.mjs";

    const evm = new EVM({});

    function clickFn(e) {
      console.log(this === e.target);
    }


    evm.watch();
    document.getElementById("btn").addEventListener("click", clickFn);
    document.getElementById("btn").addEventListener("click", clickFn, true);
    document.getElementById("btn").addEventListener("click", clickFn, true);

    window.evm = evm;

    setTimeout(function () {
      console.log("remove click 5000")
      document.getElementById("btn").removeEventListener("click", clickFn)
    }, 15000)

    setInterval(function () {
      console.log(evm.data)
    }, 5000)
    

    // setTimeout(function () {
    //   console.log("remove click 13000")
    //   document.getElementById("btn").removeEventListener("click", clickFn)
    // }, 13000)

    

    // function onResize() { }

    // window.addEventListener("resize", onResize);

    // setTimeout(function () {
    //   window.removeEventListener("resize", onResize);
    // }, 20000)
  </script>
</body>

</html>